//
//  Home5TableViewCell.m
//  MobileOffice
//
//  Created by jjkj on 16/12/15.
//  Copyright © 2016年 liaoningjujin. All rights reserved.
//

#import "Home5TableViewCell.h"

@implementation Home5TableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self=[super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.contentView.backgroundColor=[UIColor clearColor];
        self.backgroundColor=[UIColor clearColor];
        _timeLabel=[MyControl creatLabelWithFrame:CGRectMake(15, 8, 40, 20) text:@"0"];
        _timeLabel.font=FONT_13;
        _timeLabel.textAlignment=NSTextAlignmentCenter;
        [self.contentView addSubview:_timeLabel];
        
        _lineImageView=[MyControl creatImageViewWithFrame:CGRectMake(_timeLabel.x+_timeLabel.width+8, 0, 0.5, 66) imageName:@""];
        _lineImageView.backgroundColor=[UIColor lightGrayColor];
        [self.contentView addSubview:_lineImageView];
        
        _stateImageView=[MyControl creatImageViewWithFrame:CGRectMake(_timeLabel.x+_timeLabel.width, 10, 16, 16) imageName:@"checkbox_normal@2x"];
        [self.contentView addSubview:_stateImageView];
        
        _backButton=[MyControl creatButtonWithFrame:CGRectMake(_lineImageView.x+_lineImageView.width+15, 8, IPHONE_WIDTH-(_lineImageView.x+_lineImageView.width+15)-8, 50) target:self sel:@selector(buttonClick) tag:100 image:nil title:@""];
        _backButton.backgroundColor=[UIColor lightGrayColor];
        _backButton.layer.cornerRadius=5;
        [self.contentView addSubview:_backButton];
        
        
        _titleLabel=[MyControl creatLabelWithFrame:CGRectMake(5, 5, _backButton.width-45, 15) text:@""];
        _titleLabel.font=FONT_14;
        [_backButton addSubview:_titleLabel];
        
//        _signLabel=[MyControl creatLabelWithFrame:CGRectMake(_titleLabel.x+_titleLabel.width, _titleLabel.y, 15, 15) text:@""];
//        _signLabel.backgroundColor=[UIColor redColor];
//        _signLabel.textColor=[UIColor whiteColor];
//        _signLabel.layer.masksToBounds=YES;
//        _signLabel.layer.cornerRadius=_signLabel.width/2;
//        _signLabel.hidden=YES;
//        _signLabel.font=FONT_11;
//        _signLabel.textAlignment=NSTextAlignmentCenter;
//        [_backButton addSubview:_signLabel];
        
//        _signInDetailButton=[UIButton buttonWithType:UIButtonTypeCustom];
//        _signInDetailButton.frame=CGRectMake(0, 0, 60, _backButton.height);
//        _signInDetailButton.userInteractionEnabled=NO;
//        [_signInDetailButton addTarget:self action:@selector(detailClick) forControlEvents:UIControlEventTouchUpInside];
//        [_backButton addSubview:_signInDetailButton];
        
        UILabel *typeLabel=[MyControl creatLabelWithFrame:CGRectMake(5, _titleLabel.y+_titleLabel.height+5, 32, 20) text:@"地址:"];
        typeLabel.font=FONT_12;
        typeLabel.textColor=[UIColor grayColor];
        [_backButton addSubview:typeLabel];
        
        _stateLabel=[MyControl creatLabelWithFrame:CGRectMake(typeLabel.x+typeLabel.width, _titleLabel.y+_titleLabel.height+5, _titleLabel.width-(typeLabel.x+typeLabel.width), 20) text:@""];
        _stateLabel.font=FONT_12;
        _stateLabel.textColor=[UIColor grayColor];
        [_backButton addSubview:_stateLabel];
        
//        _toExplainButton=[UIButton buttonWithType:UIButtonTypeCustom];
//        _toExplainButton.frame=CGRectZero;
//        _toExplainButton.layer.masksToBounds=YES;
//        _toExplainButton.layer.cornerRadius=5;
//        _toExplainButton.hidden=YES;
//        _toExplainButton.titleLabel.font=FONT_13;
//        [_toExplainButton addTarget:self action:@selector(explainClick) forControlEvents:UIControlEventTouchUpInside];
//        [_backButton addSubview:_toExplainButton];
        
        _photoImageView=[[MyImageView alloc]initWithFrame:CGRectMake(_backButton.width-45, 5, 35, _backButton.height-10)];
        //_photoImageView.image=[UIImage imageNamed:@"k_ic_1wifi@2x"];
        [_backButton addSubview:_photoImageView];
        
        //        _beginTimeLabel=[MyControl creatLabelWithFrame:CGRectMake(_backButton.width-100, _titleLabel.y, 100, 20) text:@""];
        //        _beginTimeLabel.font=FONT_11;
        //        _beginTimeLabel.textColor=[UIColor grayColor];
        //        _beginTimeLabel.textAlignment=NSTextAlignmentCenter;
        //        [_backButton addSubview:_beginTimeLabel];
    }
    return self;
}

- (void)setCellInfoWithModel:(SignInInfoModel *)model{
    self.titleLabel.text=model.result;
    self.stateLabel.text=model.eventName;
    self.timeLabel.text=[LZXHelper getTimeStrWithOldDateFomatter:@"yyyy-MM-dd HH:mm:ss" DateStr:model.eventTime newFormatter:@"HH:mm"];
}

- (void)buttonClick{
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
